package com.example.testapplication.bean;

import android.view.View;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import com.example.testapplication.BR;


public class Start1 extends BaseObservable {
    public String name;
    @Bindable
    public int fans;

    @Bindable
    public int visibility;

    public Start1(String name, int fans) {
        this.name = name;
        this.fans = fans;
        this.visibility = View.INVISIBLE;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getFans() {
        return fans;
    }

    public void setFans(int fans) {
        this.fans = fans;
        if(this.fans % 2 == 0){
            visibility = View.GONE;
        }else{
            visibility = View.VISIBLE;
        }
        notifyPropertyChanged(BR.fans);
        notifyPropertyChanged(BR.visibility);

    }
}
